This snippet asks for the user's street address, city, and zip, and displays the map using Yahoo's map API.

================================================

<?php

	echo("<html>");	
  	echo("<head>");
	echo("</head>");
	echo("<title>");
	echo("Yahoo Search Map");
	echo("</title>");

if ($_SERVER['REQUEST_METHOD'] == 'GET')
{

echo("<h1><strong>Yahoo Search Map</strong></h1>");

echo("<form action=searchmap.php method=POST>");
echo("<table>");
echo ("<tr><td>Address:</td><td><input type = text name = 'address'/></td>");
echo ("<tr><td>City:</td><td><input type = text name = 'city'/></td>");
echo ("<tr><td>State:</td><td><input type = text name = 'state'/></td>");
echo ("<tr><td>Zip: </td><td><input type = text name = 'zip'/></td>");
echo ("<tr><td>Zoom:</td>");
echo ("<td><select name = 'zoom'>");





$MAX = 12;
for($i = 1; $i <= $MAX; $i++)
{
	echo("<option> $i </option>");
}

echo("</select>");
echo("</td>");
echo("</tr>");
echo("</table>");


echo("<input type=submit value = Submit />");
echo("</form>");



}
//POST
else if( $_SERVER['REQUEST_METHOD'] == 'POST')
{

$address=$_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$zoom = $_POST['zoom'];

$id =   "3EQqzN_V34ELbaoAAJ.WsoJKf1GxF.QHxg8QBWvObTKhsFjGWSwO3OSCzm2GRU9jeQ--";

$address = urlencode("$address");
$city = urlencode("$city");



$request = "http://local.yahooapis.com/MapsService/V1/mapImage?appid=$id&street=$address&city=$city&state=$state&zip=$zip&zoom=$zoom&output=php";  


  
  $response = file_get_contents($request);  
       
     if ($response === false) {  
         die('Request failed');  
     }  
  
     $phpobj = unserialize($response);  
   
    echo '<img src="'.$phpobj["Result"].'">';  
  

}
	
    
 ?>  